package util;

import model.service.AFactoryService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class ServicesUtil {

	@Autowired
	private AFactoryService factoryService;
	
	public AFactoryService getFactoryService() {
		return factoryService;
	}
	
	public ServicesUtil(){
		String applicationContextFilePath = System.getProperty("user.dir") + "\\WebContent\\WEB-INF\\applicationContext.xml";
		FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(applicationContextFilePath);
		appContext.getAutowireCapableBeanFactory().autowireBean(this);
	}
}
